new logger with suppression functionality#79
Merged
Conversation
1847899 to
d4e1445
Compare
MikhailArtemyev
commented
Mar 10, 2026
MikhailArtemyev
commented
Mar 10, 2026
replaced the old logger with the new one
Respects NO_COLOR, terminal detection, and piped output automatically.
Read from live suppressedSet instead of initial opts.suppressTags, so tags added via .suppress() after construction are inherited by children.
Adds "silent" to LogLevel union. Existing tests using "SILENT" updated to match the lowercase convention.
Log is the simple interface (warn, info, error, debug, dryWarn) used by most consumers. LogManager extends Log with lifecycle features (fork, as, suppress, setLevel, tagCounts, buffer).
…m generic Log Centralizes all 7 log tags into a CodegenTag union in utils/types.ts so passing an invalid tag string is now a type error. Replaces bare Log with CodegenLog across typeschema, api, and writer-generator modules.
…tag summary - Rename tags to hashtag camelCase (#binding, #fieldTypeNotFound, etc.) - Move tag display to dimmed suffix: "message (#tag)" instead of "#tag message" - Use "/" separator for forked prefixes: api/reg, api/ts - Replace printSuppressedSummary with printTagSummary that reports both emitted and suppressed tag counts separately - Add fork() overload to preserve parent tag type with suppressTags
…e LoggerOptions in mkCodegenLogger
… utils/log.ts Move generic logger engine to common-log.ts and codegen-specific logging (CodegenTag, CodegenLog, CodegenLogManager, mkCodegenLogger) from utils/types.ts into utils/log.ts. utils/types.ts now only contains generic utility types.
- Replace module-level errorLogger/silentLogger with mkErrorLogger()/mkSilentLogger() factories - Make logger a required param in registerFsAndMkTs and resolveTs - Each test describe block now creates its own logger via mkTestLogger()
6dced77 to
096d0c9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
codegen-logger.tswith a generic tagged logger (mkLogger<T>) supporting suppress-by-tag, deduplication, and buffered entriesLog(read-only) andLogManager(withfork,buffer,printTagSummary)fork()inherits parent prefix and suppressed tags; configure level/suppress only at creationsetLevel(),suppress()runtime mutators — all config viamkLogger/forkoptionsCodegenTagunion and typed aliases (CodegenLog,CodegenLogManager,mkCodegenLogger)mkCodegenLoggeralways returnsLogManager<CodegenTag>(no generic narrowing)common-log.ts, codegen-specific logging inlog.ts, pure utility types intypes.tsLog,LogEntry,LogManager,mkLogger) from package exports; expose only codegen-specific APImkErrorLogger(),mkSilentLogger(),mkTestLogger())registerFsAndMkTsandresolveTsnow require an explicit logger argument#fieldTypeNotFoundin R4 examplesenrichResolver